import {createRouter, createWebHistory} from 'vue-router'
import routes from './route'
import store from '@/store/index.js'
 
const router = createRouter({
    linkActiveClass: 'active',
    history: createWebHistory(), 
    routes
})

// router.beforeEach((to, from, next) => {
//   if (to.matched.some(record => record.meta.requiresAuth)) {
//     if (!store.getters.getToken) {
//       next('/')
//     } else {
//       next()
//     }
//   } else {
//     next()
//   }
// })
 
export default router